package com.xcesys.extras.tool.task;

import org.hibernate.tool.ant.ExporterTask;
import org.hibernate.tool.ant.ExtrasActionExporterTask;
import org.hibernate.tool.ant.ExtrasDaoExporterTask;
import org.hibernate.tool.ant.ExtrasServiceExporterTask;
import org.hibernate.tool.ant.HibernateToolTask;

public class ExtrasToolTask extends HibernateToolTask {
	private String packageName;

	public ExporterTask createModel2DaoImpl() {
		ExtrasDaoExporterTask daoImpl = new ExtrasDaoExporterTask(this, true);
		addGenerator(daoImpl);
		return daoImpl;
	}

	public ExporterTask createModel2DaoIntf() {
		ExporterTask daoIntf = new ExtrasDaoExporterTask(this, false);
		addGenerator(daoIntf);
		return daoIntf;
	}

	public ExporterTask createModel2ServiceImpl() {
		ExporterTask daoImpl = new ExtrasServiceExporterTask(this, true);
		addGenerator(daoImpl);
		return daoImpl;
	}

	public ExporterTask createModel2ServiceIntf() {
		ExporterTask daoIntf = new ExtrasServiceExporterTask(this, false);
		addGenerator(daoIntf);
		return daoIntf;
	}

	public ExporterTask createModel2Action() {
		ExporterTask daoIntf = new ExtrasActionExporterTask(this);
		addGenerator(daoIntf);
		return daoIntf;
	}

	public ExporterTask createModel2DataObject() {
		ExporterTask daoIntf = new ExtrasActionExporterTask(this);
		addGenerator(daoIntf);
		return daoIntf;
	}

	public String getPackageName() {
		return packageName;
	}

	public void setPackageName(String packageName) {
		this.packageName = packageName;
	}

}
